/***********************************************************************
 * Module:  Note.java
 * Author:  Voja
 * Purpose: Defines the Class Note
 ***********************************************************************/

package model;

import java.util.*;

public class Note {
   public int noteId;
   public java.lang.String noteCaption;
   public int noteWidth;
   public int noteHeight;
   public int noteX;
   public int noteY;
   
   public Photo photo;
   
   
   /** @pdGenerated default parent getter */
   public Photo getPhoto() {
      return photo;
   }
   
   /** @pdGenerated default parent setter
     * @param newPhoto */
   public void setPhoto(Photo newPhoto) {
      if (this.photo == null || !this.photo.equals(newPhoto))
      {
         if (this.photo != null)
         {
            Photo oldPhoto = this.photo;
            this.photo = null;
            oldPhoto.removeNote(this);
         }
         if (newPhoto != null)
         {
            this.photo = newPhoto;
            this.photo.addNote(this);
         }
      }
   }

}